SELECT T.*,
ROW_NUMBER() OVER(ORDER BY TYPE_DICTIONARY.CODE, T_PERMISSION.CODE, VALIDATE_RULE_DICTIONARY.CODE, VALIDATE_SUCCESS_DICTIONARY.CODE, VALIDATE_ERROR_DICTIONARY.CODE) RN,
TYPE_DICTIONARY.ID               AS PERMISSION_TYPE_ID,
TYPE_DICTIONARY.CODE             AS PERMISSION_TYPE_CODE,
TYPE_DICTIONARY.NAME             AS PERMISSION_TYPE_NAME,
T_PERMISSION.CODE                AS PERMISSION_CODE,
T_PERMISSION.NAME                AS PERMISSION_NAME,
VALIDATE_RULE_DICTIONARY.CODE    AS VALIDATE_RULE_CODE,
VALIDATE_RULE_DICTIONARY.NAME    AS VALIDATE_RULE_NAME,
VALIDATE_SUCCESS_DICTIONARY.CODE AS VALIDATE_SUCCESS_CODE,
VALIDATE_SUCCESS_DICTIONARY.NAME AS VALIDATE_SUCCESS_NAME,
VALIDATE_ERROR_DICTIONARY.CODE   AS VALIDATE_ERROR_CODE,
VALIDATE_ERROR_DICTIONARY.NAME   AS VALIDATE_ERROR_NAME
FROM C1_PE_VA_RU_TRANSACT_MODE T
LEFT JOIN C1_PERMISSION T_PERMISSION
ON (T_PERMISSION.ID = T.PERMISSION_ID)
LEFT JOIN C1_DICTIONARY TYPE_DICTIONARY
ON (TYPE_DICTIONARY.ID = T_PERMISSION.TYPE_ID)
LEFT JOIN C1_DICTIONARY VALIDATE_RULE_DICTIONARY
ON (VALIDATE_RULE_DICTIONARY.ID = T.VALIDATE_RULE_ID)
LEFT JOIN C1_DICTIONARY VALIDATE_SUCCESS_DICTIONARY
ON (VALIDATE_SUCCESS_DICTIONARY.ID = T.VALIDATE_SUCCESS_ID)
LEFT JOIN C1_DICTIONARY VALIDATE_ERROR_DICTIONARY
ON (VALIDATE_ERROR_DICTIONARY.ID = T.VALIDATE_ERROR_ID)
WHERE T.ID = :id